<template>
  <footer class="footer">
    <span class="todo-count"
      >剩余:<strong>{{ list.length }}</strong></span
    >
    <ul class="filters">
      <li>
        <a
          @click="changeStatus('all')"
          :class="{ selected: listStatus === 'all' }"
          href="javascript:;"
          >全部</a
        >
      </li>
      <li>
        <a
          @click="changeStatus('incompulted')"
          :class="{ selected: listStatus === 'incompulted' }"
          href="javascript:;"
          >未完成</a
        >
      </li>
      <li>
        <a
          @click="changeStatus('compulted')"
          :class="{ selected: listStatus === 'compulted' }"
          href="javascript:;"
          >已完成</a
        >
      </li>
    </ul>
    <button class="clear-completed" @click="delCompulted">清除已完成</button>
  </footer>
</template>

<script>
export default {
  name: 'MyFoot',
  props: ['list', 'listStatus'],
  methods: {
    changeStatus(listStatus) {
      this.$emit('changeStatue', listStatus)
    },
    delCompulted() {
      this.$emit('del-Compulted')
    }
  }
}
</script>
